#include "unionrobcontrollerhmiinstance.h"

void UnionRobControllerHMIInstance ::timer_FastTimerLoop(){
    if(this->pHmi != nullptr)
        this->pHmi->FastTimerLoop();
    if(this->pBackend != nullptr)
        this->pBackend->FastTimerLoop();
}
void UnionRobControllerHMIInstance ::timer_SlowTimerLoop(){
    if(this->pHmi != nullptr)
        this->pHmi->SlowTimerLoop();
    if(this->pBackend != nullptr)
        this->pBackend->SlowTimerLoop();
}

void UnionRobControllerHMIInstance ::slots_onbtnclicked_ModeSelected(short Mode){
    if(this->pBackend != nullptr){
        this->pBackend->stOperationInfo.OperationMode = Mode;
    }
}

bool UnionRobControllerHMIInstance ::slots_onbtnclicked_vPower(){
    if(this->pBackend != nullptr)
        return this->pBackend->onbtnclicked_vPower();
    else
        return 0;
}
bool UnionRobControllerHMIInstance ::slots_onbtnclicked_ESTOP(){
    if(this->pBackend != nullptr)
        return this->pBackend->onbtnclicked_ESTOP_Clicked();
    else
        return 0;
}

void UnionRobControllerHMIInstance ::slots_onbtnclicked_Setting(){
    if(this->pHmi != nullptr)
        this->pHmi->onbtnclicked_Setting();
}
void UnionRobControllerHMIInstance ::slots_onbtnclicked_Edit(){
    if(this->pHmi != nullptr)
        this->pHmi->onbtnclicked_Edit();
}
bool UnionRobControllerHMIInstance ::slots_onbtnclicked_Pause(){
    if(this->pBackend != nullptr)
        return this->pBackend->onbtnclicked_Pause();
    else
        return 0;
}
bool UnionRobControllerHMIInstance ::slots_onbtnclicked_Run(){
    if(this->pBackend != nullptr)
        return this->pBackend->onbtnclicked_Run();
    else
        return 0;
}
bool UnionRobControllerHMIInstance ::slots_onbtnclicked_Stop(){
    if(this->pBackend != nullptr)
        return this->pBackend->onbtnclicked_Stop();
    else
        return 0;
}

void UnionRobControllerHMIInstance ::slots_onbtnclicked_fn1(){
    if(this->pBackend != nullptr)
        this->pBackend->onbtnclicked_fn1();
}
void UnionRobControllerHMIInstance ::slots_onbtnclicked_fn2(){
    if(this->pBackend != nullptr)
        this->pBackend->onbtnclicked_fn2();
}
void UnionRobControllerHMIInstance ::slots_onbtnclicked_fn3(){
    if(this->pBackend != nullptr)
        this->pBackend->onbtnclicked_fn3();
}
void UnionRobControllerHMIInstance ::slots_onbtnclicked_fn4(){
    if(this->pBackend != nullptr)
        this->pBackend->onbtnclicked_fn4();
}

void UnionRobControllerHMIInstance ::slots_onbtnclicked_Home(){
    if(this->pHmi != nullptr)
        this->pHmi->onbtnclicked_Home();
}

void UnionRobControllerHMIInstance ::slots_onbtnclicked_MainScriptStatus(){
    if(this->pHmi != nullptr)
        this->pHmi->onbtnclicked_MainScriptStatus();
}
void UnionRobControllerHMIInstance ::slots_onbtnclicked_SubScriptStatus(){
    if(this->pHmi != nullptr)
        this->pHmi->onbtnclicked_SubScriptStatus();
}
void UnionRobControllerHMIInstance ::slots_onbtnclicked_VisHmi(){
    if(this->pHmi != nullptr)
        this->pHmi->onbtnclicked_VisHmi();
}
void UnionRobControllerHMIInstance :: slots_onbtnclicked_Coordinate(short& Coordinate, int& ToolID, int& WorkID){
    if(this->pHmi != nullptr){
        if(this->pBackend != nullptr){
            this->pHmi->onbtnclicked_Coordinate();
            Coordinate = this->pBackend->stOperationInfo.MotionCoordinate;
            ToolID = this->pBackend->stOperationInfo.ToolNumber;
            WorkID = this->pBackend->stOperationInfo.WorkNumber;
        }
    }
}

void UnionRobControllerHMIInstance ::slots_onbtnpressed_XP(){
    if(this->pBackend != nullptr)
        this->pBackend->onbtnpressed_XP();
}
void UnionRobControllerHMIInstance ::slots_onbtnpressed_YP(){
    if(this->pBackend != nullptr)
        this->pBackend->onbtnpressed_YP();
}
void UnionRobControllerHMIInstance ::slots_onbtnpressed_ZP(){
    if(this->pBackend != nullptr)
        this->pBackend->onbtnpressed_ZP();
}
void UnionRobControllerHMIInstance ::slots_onbtnpressed_AP(){
    if(this->pBackend != nullptr)
        this->pBackend->onbtnpressed_AP();
}
void UnionRobControllerHMIInstance ::slots_onbtnpressed_BP(){
    if(this->pBackend != nullptr)
        this->pBackend->onbtnpressed_BP();
}
void UnionRobControllerHMIInstance ::slots_onbtnpressed_CP(){
    if(this->pBackend != nullptr)
        this->pBackend->onbtnpressed_CP();
}
void UnionRobControllerHMIInstance ::slots_onbtnpressed_XN(){
    if(this->pBackend != nullptr)
        this->pBackend->onbtnpressed_XN();
}
void UnionRobControllerHMIInstance ::slots_onbtnpressed_YN(){
    if(this->pBackend != nullptr)
        this->pBackend->onbtnpressed_YN();
}
void UnionRobControllerHMIInstance ::slots_onbtnpressed_ZN(){
    if(this->pBackend != nullptr)
        this->pBackend->onbtnpressed_ZN();
}
void UnionRobControllerHMIInstance ::slots_onbtnpressed_AN(){
    if(this->pBackend != nullptr)
        this->pBackend->onbtnpressed_AN();
}
void UnionRobControllerHMIInstance ::slots_onbtnpressed_BN(){
    if(this->pBackend != nullptr)
        this->pBackend->onbtnpressed_BN();
}
void UnionRobControllerHMIInstance ::slots_onbtnpressed_CN(){
    if(this->pBackend != nullptr)
        this->pBackend->onbtnpressed_CN();
}

void UnionRobControllerHMIInstance ::slots_onbtnpressed_E1P(){
    if(this->pBackend != nullptr)
        this->pBackend->onbtnpressed_E1P();
}
void UnionRobControllerHMIInstance ::slots_onbtnpressed_E2P(){
    if(this->pBackend != nullptr)
        this->pBackend->onbtnpressed_E2P();
}
void UnionRobControllerHMIInstance ::slots_onbtnpressed_E1N(){
    if(this->pBackend != nullptr)
        this->pBackend->onbtnpressed_E1N();
}
void UnionRobControllerHMIInstance ::slots_onbtnpressed_E2N(){
    if(this->pBackend != nullptr)
        this->pBackend->onbtnpressed_E2N();
}

void UnionRobControllerHMIInstance ::slots_onbtnreleased_XP(){
    if(this->pBackend != nullptr)
        this->pBackend->onbtnreleased_XP();
}
void UnionRobControllerHMIInstance ::slots_onbtnreleased_YP(){
    if(this->pBackend != nullptr)
        this->pBackend->onbtnreleased_YP();
}
void UnionRobControllerHMIInstance ::slots_onbtnreleased_ZP(){
    if(this->pBackend != nullptr)
        this->pBackend->onbtnreleased_ZP();
}
void UnionRobControllerHMIInstance ::slots_onbtnreleased_AP(){
    if(this->pBackend != nullptr)
        this->pBackend->onbtnreleased_AP();
}
void UnionRobControllerHMIInstance ::slots_onbtnreleased_BP(){
    if(this->pBackend != nullptr)
        this->pBackend->onbtnreleased_BP();
}
void UnionRobControllerHMIInstance ::slots_onbtnreleased_CP(){
    if(this->pBackend != nullptr)
        this->pBackend->onbtnreleased_CP();
}
void UnionRobControllerHMIInstance ::slots_onbtnreleased_XN(){
    if(this->pBackend != nullptr)
        this->pBackend->onbtnreleased_XN();
}
void UnionRobControllerHMIInstance ::slots_onbtnreleased_YN(){
    if(this->pBackend != nullptr)
        this->pBackend->onbtnreleased_YN();
}
void UnionRobControllerHMIInstance ::slots_onbtnreleased_ZN(){
    if(this->pBackend != nullptr)
        this->pBackend->onbtnreleased_ZN();
}
void UnionRobControllerHMIInstance ::slots_onbtnreleased_AN(){
    if(this->pBackend != nullptr)
        this->pBackend->onbtnreleased_AN();
}
void UnionRobControllerHMIInstance ::slots_onbtnreleased_BN(){
    if(this->pBackend != nullptr)
        this->pBackend->onbtnreleased_BN();
}
void UnionRobControllerHMIInstance ::slots_onbtnreleased_CN(){
    if(this->pBackend != nullptr)
        this->pBackend->onbtnreleased_CN();
}

void UnionRobControllerHMIInstance ::slots_onbtnreleased_E1P(){
    if(this->pBackend != nullptr)
        this->pBackend->onbtnreleased_E1P();
}
void UnionRobControllerHMIInstance ::slots_onbtnreleased_E2P(){
    if(this->pBackend != nullptr)
        this->pBackend->onbtnreleased_E2P();
}
void UnionRobControllerHMIInstance ::slots_onbtnreleased_E1N(){
    if(this->pBackend != nullptr)
        this->pBackend->onbtnreleased_E1N();
}
void UnionRobControllerHMIInstance ::slots_onbtnreleased_E2N(){
    if(this->pBackend != nullptr)
        this->pBackend->onbtnreleased_E2N();
}

void UnionRobControllerHMIInstance ::slots_onbtnclicked_MannualOverrideP(double& value){
    if(this->pBackend != nullptr)
        this->pBackend->onbtnclicked_MannualOverrideP(value);
}
void UnionRobControllerHMIInstance ::slots_onbtnclicked_ProgramOverrideP(double& value){
    if(this->pBackend != nullptr)
        this->pBackend->onbtnclicked_ProgramOverrideP(value);
}
void UnionRobControllerHMIInstance ::slots_onbtnclicked_MannualOverrideN(double& value){
    if(this->pBackend != nullptr)
        this->pBackend->onbtnclicked_MannualOverrideN(value);
}
void UnionRobControllerHMIInstance ::slots_onbtnclicked_ProgramOverrideN(double& value){
    if(this->pBackend != nullptr)
        this->pBackend->onbtnclicked_ProgramOverrideN(value);
}
